<?php


namespace app\lunwen\controller;



use app\lunwen\model\EducationalCheckBestModel;
use cmf\controller\HomeBaseController;

class EducationalOperateOutPeopleController extends HomeBaseController {
    public function  index(){
        return $this->fetch(':educationalToOut');
    }

    public function test(){
        //获的数据之后加入表格  改变状态为院系已提交

        $fileNameString = $_POST["file_name"];
        $stuId = strstr($fileNameString,'_',true);
        $data = strstr($fileNameString,'_');
        $beformStuName = strstr($data,'.',true);
        $stuname = substr("$beformStuName", 1, strlen($beformStuName));

        $external = new EducationalCheckBestModel();
        $external->file_name = $_POST["file_name"];
        $external->external_name = $_POST["external_name"];
        $external->student_id = $stuId;
        $external->student_name = $stuname;
        $external->save();

        return json([
            'msg'=>'提交成功',
            'code'=>1,
        ]);
    }
}